"=============================================================================== 
"     __  ____   ___   ___     _____ __  __ ____   ____                         
"    |  \/  \ \ / /| \ | \ \   / /_ _|  \/  |  _ \ / ___|                       
"    | |\/| |\ V / |  \| |\ \ / / | || |\/| | |_) | |                           
"    | |  | | | |  | |\  | \ V /  | || |  | |  _ <| |___                        
"    |_|  |_| |_|  |_| \_|  \_/  |___|_|  |_|_| \_\\____|                       
"                                                                               
"    明天属于熬过今天的人！
"                                                                               
"    美妙人生的关键在于你能迷上什么东西!                                             
"                                                                               
"    人之所以不幸，是因为他不知道自己是幸福的，仅此而已。                              
"                                                                               
"===============================================================================
"" 配置文件位置   
"      Linux:   ~/.config/nvim/init.vim
"      MacOS:   ~/.config/nvim/init.vim
"      Windows: ~\AppData\Local\nvim\init.vim
"
"" 这个档案的双引号 (") 是批注
" echom "提示：This is init.vim"

"-------------------------------------------------------------------------------
"" 附：vim的 window 和 Linux 的区别    
	"" ------------------------------------------------------------------------
	""                    |                          区       别 
	"" ------------------------------------------------------------------------
	""      系统          |        windows        |        Linux
	"" ------------------------------------------------------------------------
	""      可视块        |        ctrl+q         |       crtl+v
	""                    | 需要按住shift才能     |
	""                    |        选择块         |
	"" ------------------------------------------------------------------------
	"" 注释：由于windows下编程习惯了保存就ctrl+s，在vim下ctrl+s整个putty终端就死了，
	""       原来ctrl+s在LINUX里是锁定屏幕的快捷键，解锁ctrl+q就可以了

" > 参考资料



""-----------------------------------------------------------------------------
"  判断操作系统是否是 Windows 还是 Linux 
	let g:isWindows = 0
	let g:isLinux = 0
	let g:isMacVim = 0
	let g:isMac = 0
	if(has("win32") || has("win64") || has("win95") || has("win16"))
		let g:isWindows = 1
		" echo "提示:这是windows系统"
		" echom "提示:这是windows系统"
	elseif(has('gui_macvim') || has('mac'))
		let g:isMac = 1
		" echo "提示: 这是 MacOS 系统"
		" echom "提示: 这是 MacOS 系统"
	elseif(has('unix'))
		let g:isLinux = 1
		" echo "提示: 这是 Linux系统"
		" echom "提示: 这是Linux系统"
	else
		" echo "提示:这是Linux系统"
		echom "提示: 不知道是什么系统"
	endif

"  判断是终端还是图形界面 Gvim
	let g:isGUI = 0
	let g:isTerminal = 0
	" echo has('gui_running')
	if has("gui_running")
		let g:isGUI = 1
	elseif(has('gui_macvim'))
		let g:isGUI = 1
	else
		let g:isGUI = 0
	endif
	" echo has('terminal')
	if has("terminal")
		let g:isTerminal = 1
	else
		let g:isTerminal = 0
	endif

"  判断是vim 还是 nvim 
	let g:isVim = 0
	let g:isNeovim = 0
	if has("nvim")
		let g:isNeovim = 1
		" echo 'isNeovim'
		" echom 'isNeovim'
	else
		let g:isVim = 1
	endif

"  判断是 是否支持python 
	let g:isPython = 0
	let g:isPython = 0
	if has("nvim")
		let g:isPython = 1
		" echo 'isPython'
		" echom 'isPython'
	else
		let g:isPython = 1
	endif

"  判断是 是否支持python3
	" echo has('python3')
	let g:isPython3 = 0
	let g:isPython3 = 0
	if has("python3")
		let g:isPython3 = 1
		" echo 'isPython3'
		" echom 'isPython3'
	else
		let g:isPython3 = 1
	endif

" 使用举例
	" echo isWindows
	" if(isWindows)
	"     echo "isWindows = 1"
	"     " 执行该环境下的配置
	" else
	"     echo "isWindows = 0"
	"     echom "isWindows = 0"
	"     " 执行该环境下的配置
	" endif



" 拆分配置文件

if(isWindows)
    echo "isWindows = 1"
    " 执行该环境下的配置
	source ~/AppData/Local/nvim/general.vim
	source ~/AppData/Local/nvim/fonts.vim
	source ~/AppData/Local/nvim/plugins.vim
	" source ~/AppData/Local/nvim/plugins-vim-which-key.vim
	" source ~/AppData/Local/nvim/functions-user.vim
	source ~/AppData/Local/nvim/themes.vim
	source ~/AppData/Local/nvim/mappings.vim
	" source ~/AppData/Local/nvim/other.vim
else
    "echo "isWindows = 0"
    "echom "isWindows = 0"
    "" 执行该环境下的配置
	source ~/.config/nvim/general.vim
	source ~/.config/nvim/fonts.vim
	source ~/.config/nvim/plugins.vim
	" source ~/.config/nvim/plugins-vim-which-key.vim
	" source ~/.config/nvim/functions-user.vim
	source ~/.config/nvim/themes.vim
	source ~/.config/nvim/mappings.vim
	" source ~/.config/nvim/other.vim
endif


